package com.videolib.service;

public class ServiceProxy implements com.videolib.service.Service {
  private String _endpoint = null;
  private com.videolib.service.Service service = null;
  
  public ServiceProxy() {
    _initServiceProxy();
  }
  
  public ServiceProxy(String endpoint) {
    _endpoint = endpoint;
    _initServiceProxy();
  }
  
  private void _initServiceProxy() {
    try {
      service = (new com.videolib.service.ServiceServiceLocator()).getService();
      if (service != null) {
        if (_endpoint != null)
          ((javax.xml.rpc.Stub)service)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
        else
          _endpoint = (String)((javax.xml.rpc.Stub)service)._getProperty("javax.xml.rpc.service.endpoint.address");
      }
      
    }
    catch (javax.xml.rpc.ServiceException serviceException) {}
  }
  
  public String getEndpoint() {
    return _endpoint;
  }
  
  public void setEndpoint(String endpoint) {
    _endpoint = endpoint;
    if (service != null)
      ((javax.xml.rpc.Stub)service)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
    
  }
  
  public com.videolib.service.Service getService() {
    if (service == null)
      _initServiceProxy();
    return service;
  }
  
  public com.videolib.pojo.User[] getUserInfo(int membershipId) throws java.rmi.RemoteException{
    if (service == null)
      _initServiceProxy();
    return service.getUserInfo(membershipId);
  }
  
  public java.lang.String signIn(int membershipId, java.lang.String password) throws java.rmi.RemoteException{
    if (service == null)
      _initServiceProxy();
    return service.signIn(membershipId, password);
  }
  
  public java.lang.String signUp(java.lang.String firstname, java.lang.String lastname, java.lang.String username, java.lang.String password, java.lang.String address, java.lang.String city, java.lang.String state, java.lang.String zipcode) throws java.rmi.RemoteException{
    if (service == null)
      _initServiceProxy();
    return service.signUp(firstname, lastname, username, password, address, city, state, zipcode);
  }
  
  public java.lang.String deleteUser(int membershipId) throws java.rmi.RemoteException{
    if (service == null)
      _initServiceProxy();
    return service.deleteUser(membershipId);
  }
  
  public java.lang.String createMovie(java.lang.String movie_name, java.lang.String release_date, java.lang.String banner_name, java.lang.String category, int available_copies) throws java.rmi.RemoteException{
    if (service == null)
      _initServiceProxy();
    return service.createMovie(movie_name, release_date, banner_name, category, available_copies);
  }
  
  public java.lang.String deleteMovie(int movie_id) throws java.rmi.RemoteException{
    if (service == null)
      _initServiceProxy();
    return service.deleteMovie(movie_id);
  }
  
  public java.lang.String rentMovie(int membershipId, int movie_id) throws java.rmi.RemoteException{
    if (service == null)
      _initServiceProxy();
    return service.rentMovie(membershipId, movie_id);
  }
  
  public java.lang.String returnMovie(int membershipId, int movie_id) throws java.rmi.RemoteException{
    if (service == null)
      _initServiceProxy();
    return service.returnMovie(membershipId, movie_id);
  }
  
  public com.videolib.pojo.PremiumUser[] listAllPremiumusers() throws java.rmi.RemoteException{
    if (service == null)
      _initServiceProxy();
    return service.listAllPremiumusers();
  }
  
  public com.videolib.pojo.SimpleUser[] listAllSimpleusers() throws java.rmi.RemoteException{
    if (service == null)
      _initServiceProxy();
    return service.listAllSimpleusers();
  }
  
  public com.videolib.pojo.Movie[] listAllMovies() throws java.rmi.RemoteException{
    if (service == null)
      _initServiceProxy();
    return service.listAllMovies();
  }
  
  public com.videolib.pojo.User[] listAllUsers() throws java.rmi.RemoteException{
    if (service == null)
      _initServiceProxy();
    return service.listAllUsers();
  }
  
  public java.lang.String updateUserDetails(int membershipId, java.lang.String firstname, java.lang.String lastname, java.lang.String username, java.lang.String password, java.lang.String address, java.lang.String city, java.lang.String state, java.lang.String zipcode) throws java.rmi.RemoteException{
    if (service == null)
      _initServiceProxy();
    return service.updateUserDetails(membershipId, firstname, lastname, username, password, address, city, state, zipcode);
  }
  
  public java.lang.String updateMovieDetails(int movie_id, java.lang.String movie_name, java.lang.String release_date, java.lang.String banner_name, java.lang.String category, int available_copies) throws java.rmi.RemoteException{
    if (service == null)
      _initServiceProxy();
    return service.updateMovieDetails(movie_id, movie_name, release_date, banner_name, category, available_copies);
  }
  
  public com.videolib.pojo.User[] searchUser(int column_number, java.lang.String search_value) throws java.rmi.RemoteException{
    if (service == null)
      _initServiceProxy();
    return service.searchUser(column_number, search_value);
  }
  
  public com.videolib.pojo.Movie[] searchMovie(int column_number, java.lang.String search_value) throws java.rmi.RemoteException{
    if (service == null)
      _initServiceProxy();
    return service.searchMovie(column_number, search_value);
  }
  
  public com.videolib.pojo.Movie[] getMovieInfo(int movie_id) throws java.rmi.RemoteException{
    if (service == null)
      _initServiceProxy();
    return service.getMovieInfo(movie_id);
  }
  
  public com.videolib.pojo.Bill[] generatebill(int membershipId) throws java.rmi.RemoteException{
    if (service == null)
      _initServiceProxy();
    return service.generatebill(membershipId);
  }
  
  
}